<div id="title_bloc" class="app_contents">
    <h1>Liste des <strong>: USERS</strong></h1>
</div>

<?php $this->config->includePartial( BackendModulesList::MAIN, 'flashes', array( 'flashes' => $flashes ) ) ;?>

<div id="table_header">
    <ul class="th">
        <li>NAME</li>
        <li>USERNAME</li>
        <li>EMAIL</li>
        <li class="tab_actions">&nbsp;</li>
    </ul>
</div>

<?php if( count( $result ) ) : ?>
    <div id="table">
    <?php $i = 0;?>
    <?php foreach( $result as $user ) : ?>
        <?php if($user instanceof UserVO): ?>
        <ul<?php if ( ! ($i%2) ) { echo ' class="alt"' ; } ?>>
            <li><?php echo $user->firstName . " " . $user->lastName ; ?></li>
            <li><?php echo $user->userName ; ?></li>
            <li><?php echo $user->email ; ?></li>
            <li class="tab_actions">
            <?php
                echo HtmlHelper::linkTo
                (
                    HtmlHelper::UIButton( "pencil" ),
                    UriHelper::get( BackendModulesList::USERS, BackendActionsList::EDIT, array( 'id' => $user->id ) ),
                    array( 'title' => "Editer" )
                );

                echo HtmlHelper::linkTo
                (
                    HtmlHelper::UIButton( "closethick" ),
                    UriHelper::get( BackendModulesList::USERS, BackendActionsList::DELETE, array( 'id' => $user->id ) ),
                    array( 'title' => "Supprimer"),
                    'Êtes-vous sûr de vouloir supprimer cet utilisateur ?'
                );
            ?>
            </li>
        </ul>
        <?php $i++ ;?>
        <?php endif; ?>
    <?php endforeach ; ?>
    </div>
<?php endif; ?>
<?php echo HtmlHelper::linkTo( HtmlHelper::UIButton( 'plusthick') . 'Ajouter un utilisateur', UriHelper::get( BackendModulesList::USERS, BackendActionsList::ADD ), array( 'title' => 'Ajouter un utilisateur') ); ?>
